package com.yifushidai.utils;

/**
 * 枚举ErrorCode方法
 *
 * @author wxw
 * @version 1.0
 * @date 2018年3月28日 下午4:45:59
 */
public enum ErrorCodeEnum {
    SUCCESS(0, "success"),
    SYSTEM_ERROR(500, "系统异常"),
    TOKEN_NULL(501, "令牌为空"),
    APPTYPE_NULL(502, "appType为空"),
    TOKEN_EXPIRE(503, "令牌失效"),
    SMS_CODE_WRONG(504, "短信验证码错误"),
    DATA_NULL(505, "数据不存在"),
    ARGUMENT_MISS(506, "缺少参数"),
    ARGUMENT_VALIDATION(507, "参数校验异常"),
    DATA_DUPLICATE(508, "数据已存在"),
    OLD_MOBILE_WRONG(509, "旧手机号错误"),
    SQL_ILLEGAL(510, "SQL包含非法字符"),
    ARGUMENT_TYPE_NOTMATCH(511, "参数类型不匹配"),
    TEST_CODE_WRONG(512, "测试账号验证码错误"),
    ONLINE_ERROR(513, "在线状态异常"),
    ICCARD_MAX_BIND(514, "超过IC卡绑定上限"),
    ICCARD_TYPE_DUPLICATE(515, "IC卡类型重复"),
    FILE_UPLOAD_FAIL(516, "文件上传失败"),
    FILE_TYPE_WRONG(517, "文件不是图片类型"),
    DATASOURCE_ERROR(518, "数据库异常"),
    APK_NEWEST_ERROR(519, "已是最新版本"),
    MINA_PUSH_ERROR(520, "网络异常，请稍后再试..."),
    PASSWORD_VALIDATION(521, "校验密码：只能输入6-20个字母、数字、下划线"),
    PASSWORD_WRONG(522, "密码错误"),
    MOBILE_NULL(523, "手机号未注册"),
    MOBILE_ERROR(524, "手机号格式错误"),
    OCR_ERROR(525, "图片识别失败"),
    MAC_NULL(526, "联网设备未绑定"),
    MAC_INVALID(527, "MAC参数无效"),
    MAC_PERMISSION(528, "管理员权限不足"),
    MAC_LOCAL_INIT(529, "联网设备已解绑成功！请在本地重新初始化联网设备！");

    private int code;
    private String name;

    ErrorCodeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }
}